import request from '@/utils/request'

export function getQuestionList(data) {
    // 获取题库列表
    return request({
        url: '/question/getPageList',
        method: 'post',
        data
    })
}

export function addQuestion(data) {
    // 添加题库
    return request({
        url: '/question/save',
        method: 'post',
        data
    })
}

export function editQuestion(data) {
    // 修改题库
    return request({
        url: '/question/update',
        method: 'post',
        data
    })
}

export function deleteQuestion(data) {
    // 删除题库
    return request({
        url: '/question/delete',
        method: 'post',
        data
    })
}

export function detailQuestion(id) {
    // 题目详情
    return request({
        url: `/question/select/${id}`,
        method: 'post'
    })
}

export function getChapterTree() {
    // 章节树形
    return request({
        url: `/chapter/getTree`,
        method: 'post'
    })
}